package com.example.common.exception;

import lombok.Getter;

@Getter
public enum ErrorCode {
    // 系统错误 (1xxxx)
    DB_CONNECTION_FAILED(10001, "Database connection failed", "v1.2"),
    
    // 参数校验 (4xxxx)
    INVALID_AMOUNT(40011, "订单金额参数非法", "v1.5"),
    
    // 业务错误 (5xxxx)
    STOCK_SHORTAGE(50021, "当前库存不足", "v1.3");
    
    private final int code;
    private final String desc;
    private final String version;
    
    ErrorCode(int code, String desc, String version) {
        this.code = code;
        this.desc = desc;
        this.version = version;
    }
}
